package demo2;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BookTest {

    @Test
    public void test1() {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean1.xml");
        final Book book = context.getBean("book", Book.class);

        System.out.println(book);

        System.out.println(book == context.getBean("book", Book.class));
        System.out.println(book.equals(context.getBean("book", Book.class)));


        final Book book2 = context.getBean("book2", Book.class);

        System.out.println(book2);

    }
}
